diff --git a/boot/vbe_simple.c b/boot/vbe_simple.c
index 1ccd416..59676d8 100644
--- a/boot/vbe_simple.c
+++ b/boot/vbe_simple.c
@@ -17,37 +17,11 @@
 #include <memalign.h>
 #include <mmc.h>
 #include <vbe.h>
-#include <version_string.h>
 #include <dm/device-internal.h>
 #include <dm/ofnode.h>
 #include <u-boot/crc.h>
 #include "vbe_simple.h"
 
-enum {
-	MAX_VERSION_LEN		= 256,
-
-	NVD_HDR_VER_SHIFT	= 0,
-	NVD_HDR_VER_MASK	= 0xf,
-	NVD_HDR_SIZE_SHIFT	= 4,
-	NVD_HDR_SIZE_MASK	= 0xf << NVD_HDR_SIZE_SHIFT,
-
-	/* Firmware key-version is in the top 16 bits of fw_ver */
-	FWVER_KEY_SHIFT		= 16,
-	FWVER_FW_MASK		= 0xffff,
-
-	NVD_HDR_VER_CUR		= 1,	/* current version */
-};
-
-/** struct simple_state - state information read from media
- *
- * @fw_version: Firmware version string
- * @fw_vernum: Firmware version number
- */
-struct simple_state {
-	char fw_version[MAX_VERSION_LEN];
-	u32 fw_vernum;
-};
-
 /** struct simple_nvdata - storage format for non-volatile data */
 struct simple_nvdata {
 	u8 crc8;
@@ -116,7 +90,7 @@
 	return 0;
 }
 
-static int simple_read_state(struct udevice *dev, struct simple_state *state)
+int vbe_simple_read_state(struct udevice *dev, struct simple_state *state)
 {
 	ALLOC_CACHE_ALIGN_BUFFER(u8, buf, MMC_MAX_BLOCK_LEN);
 	struct simple_priv *priv = dev_get_priv(dev);
@@ -157,7 +131,7 @@
 	struct simple_state state;
 	int ret;
 
-	ret = simple_read_state(dev, &state);
+	ret = vbe_simple_read_state(dev, &state);
 	if (ret)
 		return log_msg_ret("read", ret);
 
@@ -206,78 +180,6 @@
 	.read_file	= vbe_simple_read_file,
 };
 
-int vbe_simple_fixup_node(ofnode node, struct simple_state *state)
-{
-	char *version;
-	int ret;
-
-	version = strdup(state->fw_version);
-	if (!version)
-		return log_msg_ret("dup", -ENOMEM);
-
-	ret = ofnode_write_string(node, "cur-version", version);
-	if (ret)
-		return log_msg_ret("ver", ret);
-	ret = ofnode_write_u32(node, "cur-vernum", state->fw_vernum);
-	if (ret)
-		return log_msg_ret("num", ret);
-	ret = ofnode_write_string(node, "bootloader-version", version_string);
-	if (ret)
-		return log_msg_ret("bl", ret);
-
-	return 0;
-}
-
-/**
- * bootmeth_vbe_simple_ft_fixup() - Write out all VBE simple data to the DT
- *
- * @ctx: Context for event
- * @event: Event to process
- * @return 0 if OK, -ve on error
- */
-static int bootmeth_vbe_simple_ft_fixup(void *ctx, struct event *event)
-{
-	oftree tree = event->data.ft_fixup.tree;
-	struct udevice *dev;
-
-	/*
-	 * Ideally we would have driver model support for fixups, but that does
-	 * not exist yet. It is a step too far to try to do this before VBE is
-	 * in place.
-	 */
-	for (vbe_find_first_device(&dev); dev; vbe_find_next_device(&dev)) {
-		struct simple_state state;
-		ofnode node, subnode;
-		int ret;
-
-		if (strcmp("vbe_simple", dev->driver->name))
-			continue;
-
-		/* Check if there is a node to fix up */
-		node = oftree_path(tree, "/chosen/fwupd");
-		if (!ofnode_valid(node))
-			continue;
-		subnode = ofnode_find_subnode(node, dev->name);
-		if (!ofnode_valid(subnode))
-			continue;
-
-		log_debug("Fixing up: %s\n", dev->name);
-		ret = device_probe(dev);
-		if (ret)
-			return log_msg_ret("probe", ret);
-		ret = simple_read_state(dev, &state);
-		if (ret)
-			return log_msg_ret("read", ret);
-
-		ret = vbe_simple_fixup_node(subnode, &state);
-		if (ret)
-			return log_msg_ret("fix", ret);
-	}
-
-	return 0;
-}
-EVENT_SPY(EVT_FT_FIXUP, bootmeth_vbe_simple_ft_fixup);
-
 static int bootmeth_vbe_simple_probe(struct udevice *dev)
 {
 	struct simple_priv *priv = dev_get_priv(dev);
